﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using OgilvyOne.BLL;
using OgilvyOne.Model;


public partial class admin_manager_role_modify :AdminBasePage
{
    public string rolename;
    public string remark;
    RoleModel model;
    protected void Page_Load(object sender, EventArgs e)
    {
        this.PopedomValidate(layerid, MOD);       
            rolename = Request.Params["name"];
            model = new RoleBll().GetModel(rolename);
            remark = model.Remark;
            if (!IsPostBack)
            {
                header.Text = new ColumnBll().LayeridSysColumnNaiv(Layerid);
                re.InnerText = model.Remark;
            }
        
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        model.Remark = re.Value;            
        try
        {            
            if (new RoleBll().Update(model))
            {
                string user = new AdminBasePage().GetSessionUsersModel().Username;
                this.insertLog(user + "修改角色" + rolename + "的备注为" + re.Value);
                Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), Guid.NewGuid().ToString(), "alert('修改成功！');window.location=\"role_list.aspx?layerid="+Layerid+"\"", true);
            }
        }
        catch (Exception ex)
        {
            Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), Guid.NewGuid().ToString(), "alert('" + ex.ToString() + "');", true);
        }
    }
}
